
<template>
<div>
<h1>Register</h1>
<form @submit.prevent="register">
  <input type="text" v-model="username" placeholder="Username" />
  <input type="password" v-model="password" placeholder="Password" />
  <button type="submit">Register</button>
</form>
</div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';

export default defineComponent({
  setup() {
    const username = ref('');
    const password = ref('');

    const register = () => {
      // 实现注册逻辑
      console.log('Register:', username.value, password.value);
    };

    return {
      username,
      password,
      register,
    };
  },
});
</script>